#{extends 'Courses/base.html' /}
#{set 'showCommunityCourseInfo'}
<li class='active'>
	<a href="#" >信息页（community）</a>
</li>
#{/set}
		
	    <h2>类别名称：</h2>
	    <hr>
		<form class="form-inline"  action="@{CourseCategories.changeCategoryName }">
            <input type='hidden' name='id' value='${category.id}'>
            <div class="form-group">
	    				<label for="name"></label>
	    				<input type="text" name="name" value='${category.name}' class="form-control" placeholder="输入新类别名称：" required="required">
	  		</div>
            <div class="form-group">
		   				<button class='btn btn-success' type='submit' >保存</button>
		   				<a class='btn btn-primary'  href='@{CourseCategories.showCourseCategories(2) }' >返回</a>
		   				<a class='btn btn-primary'  href='@{Courses.addCommunityCourse(category.id) }' >发布课程</a>
		   </div>
		</form>
	    <hr>
		<h2>社区课程</h2>
		<div class=" nav-tabs">
	 	<hr>
	   <form class="navbar-search" action="@{Courses.showCommunityCourses}" method="get">
	     <div class="form-group">
		 	<input type="hidden" name="categoryId" value="${category.id}" />
		 	<input type="text" name="searchKey" id="keyword" class="search-query" value="${searchKey}"  placeholder="请输入关键字" />
		 	<input type="submit" class="btn btn-default" value="搜索" />
		  </div>	
		  #{page pageBean:pageBean,params:params/}
	   </form>
	  	<hr>
				
				#{list items:list,as:'course'}
				<div>
					<p>序号：${course_index+(curPage-1)*pageBean.perPage}:</p>
					<p>课程名称：${course.title}</p>
					<p>课程图片：<img alt="" src="${course.photo}" width="200px" height="150px"></p>
					<!-- <p>课程概述：${course.body}</p> -->
					<p>课程类目：${course.getCourseCategory()?.name}</p>
					<p>发布者：${course.getAuthorName()}</p>
					<p>发布时间：${course.showPubTime()}</p>
					<p>开始时间：${course.showStartTime()}</p>
					<p>结束时间：${course.showEndTime()}</p>
					<p>操作：
					 #{if course.audit>=1 }   
						<a href="@{Courses.changeCommunityAudit(course.id,category.id,0)}"  class="btn btn-success">已审核</a>
					 #{/if}
					 #{else}
					    <a href="@{Courses.changeCommunityAudit(course.id,category.id,1)}"  class="btn btn-primary">未审核</a>
					 #{/else}
					    <a href="@{Courses.showCommunityCourseInfo(course.id)}" class="btn btn-success">编辑</a>
					    <a href="@{Courses.delCommunityCourse(course.id,category.id)}" onclick="return confirm('删除视频链接：${course.title}?')" class="btn btn-danger">删除</a>
					</p>
				</div>	
				<hr>
				#{/list}
				
				#{page pageBean:pageBean,params:params/} 
